<!--
 * @Author: liuyonghu
 * @Date: 2021-10-26 17:48:23
 * @LastEditTime: 2021-10-26 18:20:50
 * @LastEditors: liuyonghu
 * @Description: 
 * @FilePath: /demos/1.html
-->

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
        .warpper {
            height: 100%;
            background: orange;
            color: white;
        }
    </style>
</head>



<body>
    <div id="app" style="width: 900px; height: 900px">
        {{message}}
        <todo>
            <!-- <template slot-scope="props"> -->
            <!-- {{props.msg}} -->
            <!-- </template> -->

            <template v-slot:default>default --</template>

            <!-- <template v-slot:default="{msg}">
                default -- {{ msg }}
            </template> -->

            <template v-slot:msg1="{msg1}">
                <b>msg1 == {{ msg1 }}</b>
            </template>

            <!-- <template v-slot:msg1>
                <b> msg1 == </b>
            </template> -->
        </todo>


    </div>
    <script type="text/x-template" id="my-template">
        <div>
              <slot :msg='msg'></slot>
        </div>
          <p>----</p>
          <div>
              <slot name='msg1' :msg1='msg1'></slot>
          </div>
    </script>
    <script>
        window.onload = () => {
            console.log(' vue - \n ', Vue);

            var app = Vue.createApp({
                data() {
                    return {
                        message: '123',
                        user: { lastName: '666', firstName: '666' },
                        //   slotProps:{ user: { lastName: "666",firstName: "666" }}
                    };
                },
            });

            app.component('todo', {
                template: '#my-template',
                // template: "<span><slot name='msg1' :msg1='msg1'></slot></span>",

                //                 template: `
                //     <div class="warpper">
                //         <div>
                //             <slot :msg='msg'></slot>
                //         </div>
                //         <p>----</p>
                //         <div>
                //             <slot name='msg1' :msg1='msg1'></slot>
                //         </div>
                //     </div>
                //    `,

                //                 template: `
                //         <div>
                //             <slot :msg='msg'></slot>
                //         </div>
                //         <p>----</p>
                //         <div>
                //             <slot name='msg1' :msg1='msg1'></slot>
                //         </div>
                //    `,

                // template: "<span><slot :msg='msg'></slot></span>",
                //   "<span><slot :user='user'>{{ user.lastName }}</slot></span>",

                data() {
                    return {
                        msg1: ' msg1 child component ',
                        msg: ' msg child component ',
                    };
                },
                setup(){
               
                }
            });
            app.mount('#app');
        };
    </script>

    <!-- <script src="vendors/vue.global.prod.min.js"></script> -->
    <script src="https://cdn.staticfile.net/vue/3.3.4/vue.global.prod.min.js"></script>
</body>

</html>